package com.pvdnc.dxhook;

import java.lang.reflect.Method;

public class HookCallback {
    private boolean mNeedToCallOldMethod;

    public HookCallback(){
        mNeedToCallOldMethod=true;
    }

    boolean needToCallOldMethod(){
        return mNeedToCallOldMethod;
    }

    void reset(){
        mNeedToCallOldMethod=true;
    }

    private Object mResult;

    public void setResult(Object result){
        mResult=result;
        mNeedToCallOldMethod=false;
    }

    public Object getResult(){
        return mResult;
    }

    public void beforeHookedMethod(Method oldMethod,Object oldObject,Object thisRef,Object[] args){}

    public void afterHookedMethod(Method oldMethod,Object oldObject,Object thisRef,Object[] args){}
}
